package com.example.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot.controller.DetailDTO;
import com.example.springboot.entity.Detail;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface DetailMapper extends BaseMapper<DetailDTO> {
    @Select("SELECT * FROM detail")
    List<Detail> findAll();
    @Insert("INSERT into detail(did,consignee,tel,address,time) VALUES(#{did},#{consignee},#{tel},#{address},#{time})")
    int insert(Detail detail);
    @Update("UPDATE detail SET did=#{did},consignee=#{consignee},tel=#{tel},address=#{address},time=#{time}")
    Integer update(Detail detail);
    @Delete("DELETE FROM detail WHERE did=#{did}")
    Integer deleteByDid(Long did);
    @Select("SELECT * FROM detail WHERE did=#{did}")
    List<Detail> findByDid(Long did);
}
